home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 85 / CD Actual 85 Febrero 2004.iso / Experto / Apache / apache_2.0.48-win32-x86-no_ssl.msi / Data.Cab / F252754_mod_mime.xml < prev    next >
Encoding:
Extensible Markup Language  |  2003-04-15  |  38.6 KB  |  869 lines

  1. <?xml version="1.0"?>
  2. <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
  3. <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
  4. <modulesynopsis metafile="mod_mime.xml.meta">
  5.  
  6. <name>mod_mime</name>
  7. <description>Associates the requested filename's extensions
  8.     with the file's behavior (handlers and filters)
  9.     and content (mime-type, language, character set and
  10.     encoding)</description>
  11. <status>Base</status>
  12. <sourcefile>mod_mime.c</sourcefile>
  13. <identifier>mime_module</identifier>
  14.  
  15. <summary>
  16.     <p>This module is used to associate various bits of "meta
  17.     information" with files by their filename extensions. This
  18.     information relates the filename of the document to it's
  19.     mime-type, language, character set and encoding. This
  20.     information is sent to the browser, and participates in content
  21.     negotiation, so the user's preferences are respected when
  22.     choosing one of several possible files to serve. See
  23.     <module>mod_negotiation</module> for more information
  24.     about <a href="../content-negotiation.html">content negotiation</a>.</p>
  25.  
  26.     <p>The directives <directive
  27.     module="mod_mime">AddCharset</directive>, <directive
  28.     module="mod_mime">AddEncoding</directive>, <directive
  29.     module="mod_mime">AddLanguage</directive> and <directive
  30.     module="mod_mime">AddType</directive> are all used to map file
  31.     extensions onto the meta-information for that file. Respectively
  32.     they set the character set, content-encoding, content-language,
  33.     and MIME-type (content-type) of documents.  The directive <directive
  34.     module="mod_mime">TypesConfig</directive> is used to specify a
  35.     file which also maps extensions onto MIME types. </p>
  36.  
  37.     <p>In addition, <module>mod_mime</module> may define the <a
  38.     href="../handler.html">handler</a> and <a
  39.     href="../filter.html">filters</a> that originate and process
  40.     content.  The directives <directive
  41.     module="mod_mime">AddHandler</directive>, <directive
  42.     module="mod_mime">AddOutputFilter</directive>, and <directive
  43.     module="mod_mime">AddInputFilter</directive> control the modules
  44.     or scripts that serve the document.  The <directive
  45.     module="mod_mime">MultiviewsMatch</directive> directive allows
  46.     <module>mod_negotiation</module> to consider these file extensions
  47.     to be included when testing Multiviews matches.</p>
  48.  
  49.     <p>While <module>mod_mime</module> associates meta-information
  50.     with filename extensions, the <module>core</module> server
  51.     provides directives that are used to associate all the files in a
  52.     given container (<em>e.g.</em>, <directive type="section"
  53.     module="core">Location</directive>, <directive type="section"
  54.     module="core">Directory</directive>, or <directive type="section"
  55.     module="core">Files</directive>) with particular
  56.     meta-information. These directives include <directive
  57.     module="core">ForceType</directive>, <directive
  58.     module="core">SetHandler</directive>, <directive
  59.     module="core">SetInputFilter</directive>, and <directive
  60.     module="core">SetOutputFilter</directive>.  The core directives
  61.     override any filename extension mappings defined in
  62.     <module>mod_mime</module>.</p>
  63.  
  64.     <p>Note that changing the meta-information for a file does not
  65.     change the value of the <code>Last-Modified</code> header.
  66.     Thus, previously cached copies may still be used by a client or
  67.     proxy, with the previous headers. If you change the
  68.     meta-information (language, content type, character set or
  69.     encoding) you may need to 'touch' affected files (updating
  70.     their last modified date) to ensure that all visitors are
  71.     receive the corrected content headers.</p>
  72. </summary>
  73. <seealso><directive
  74. module="mod_mime_magic">MimeMagicFile</directive></seealso>
  75. <seealso><directive module="core">AddDefaultCharset</directive></seealso>
  76. <seealso><directive module="core">ForceType</directive></seealso>
  77. <seealso><directive module="core">DefaultType</directive></seealso>
  78. <seealso><directive module="core">SetHandler</directive></seealso>
  79. <seealso><directive module="core">SetInputFilter</directive></seealso>
  80. <seealso><directive module="core">SetOutputFilter</directive></seealso>
  81.  
  82. <section id="multipleext"><title>Files with Multiple Extensions</title>
  83.     <p>Files can have more than one extension, and the order of the
  84.     extensions is <em>normally</em> irrelevant. For example, if the
  85.     file <code>welcome.html.fr</code> maps onto content type
  86.     <code>text/html</code> and language French then the file
  87.     <code>welcome.fr.html</code> will map onto exactly the same information.
  88.     If more than one extension is given which maps onto the same
  89.     type of meta-information, then the one to the right will be
  90.     used. For example, if <code>.gif</code> maps to the MIME-type
  91.     <code>image/gif</code> and <code>.html</code> maps to the MIME-type
  92.     <code>text/html</code>, then the file <code>welcome.gif.html</code>
  93.     will be associated with the MIME-type <code>text/html</code>.</p>
  94.  
  95.     <p>Care should be taken when a file with multiple extensions
  96.     gets associated with both a MIME-type and a handler. This will
  97.     usually result in the request being by the module associated
  98.     with the handler. For example, if the <code>.imap</code>
  99.     extension is mapped to the handler <code>imap-file</code> (from
  100.     <module>mod_imap</module>) and the <code>.html</code> extension is
  101.     mapped to the MIME-type <code>text/html</code>, then the file
  102.     <code>world.imap.html</code> will be associated with both the
  103.     <code>imap-file</code> handler and <code>text/html</code> MIME-type.
  104.     When it is processed, the <code>imap-file</code> handler will be used,
  105.     and so it will be treated as a <module>mod_imap</module> imagemap
  106.     file.</p>
  107. </section>
  108.  
  109. <section id="contentencoding"><title>Content encoding</title>
  110.     <p>A file of a particular MIME type can additionally be encoded a
  111.     particular way to simplify transmission over the Internet.
  112.     While this usually will refer to compression, such as
  113.     <code>gzip</code>, it can also refer to encryption, such a
  114.     <code>pgp</code> or to an encoding such as UUencoding, which is
  115.     designed for transmitting a binary file in an ASCII (text)
  116.     format.</p>
  117.  
  118.     <p>The <a href="http://www.ietf.org/rfc/rfc2616.txt">HTTP/1.1
  119.     RFC</a>, section 14.11 puts it this way:</p>
  120.  
  121.     <blockquote cite="http://www.ietf.org/rfc/rfc2616.txt">
  122.       <p>The Content-Encoding entity-header field is used as a modifier to
  123.       the media-type. When present, its value indicates what additional
  124.       content codings have been applied to the entity-body, and thus what
  125.       decoding mechanisms must be applied in order to obtain the media-type
  126.       referenced by the Content-Type header field. Content-Encoding is
  127.       primarily used to allow a document to be compressed without losing
  128.       the identity of its underlying media type.</p>
  129.     </blockquote>
  130.  
  131.     <p>By using more than one file extension (see <a
  132.     href="#multipleext">section above about multiple file
  133.     extensions</a>), you can indicate that a file is of a
  134.     particular <em>type</em>, and also has a particular
  135.     <em>encoding</em>. </p>
  136.  
  137.     <p>For example, you may have a file which is a Microsoft Word
  138.     document, which is pkzipped to reduce its size. If the
  139.     <code>.doc</code> extension is associated with the Microsoft
  140.     Word file type, and the <code>.zip</code> extension is
  141.     associated with the pkzip file encoding, then the file
  142.     <code>Resume.doc.zip</code>would be known to be a pkzip'ed Word
  143.     document.</p>
  144.  
  145.     <p>Apache sends a <code>Content-encoding</code> header with the
  146.     resource, in order to tell the client browser about the
  147.     encoding method.</p>
  148.  
  149.     <example>Content-encoding: pkzip</example>
  150. </section>
  151.  
  152. <section id="charset-lang"><title>Character sets and languages</title>
  153.     <p>In addition to file type and the file encoding,
  154.     another important piece of information is what language a
  155.     particular document is in, and in what character set the file
  156.     should be displayed. For example, the document might be written
  157.     in the Vietnamese alphabet, or in Cyrillic, and should be
  158.     displayed as such. This information, also, is transmitted in
  159.     HTTP headers.</p>
  160.  
  161.     <p>The character set, language, encoding and mime type are all 
  162.     used in the process of content negotiation (See 
  163.     <module>mod_negotiation</module>) to determine
  164.     which document to give to the client, when there are
  165.     alternative documents in more than one character set, language, 
  166.     encoding or mime type. All filename extensions associations
  167.     created with <directive module="mod_mime">AddCharset</directive>,
  168.     <directive module="mod_mime">AddEncoding</directive>, <directive
  169.     module="mod_mime">AddLanguage</directive> and <directive
  170.     module="mod_mime">AddType</directive> directives
  171.     (and extensions listed in the <directive module="mod_mime_magic"
  172.     >MimeMagicFile</directive>) participate in this select process.
  173.     Filename extensions that are only associated using the <directive
  174.     module="mod_mime">AddHandler</directive>, <directive module="mod_mime"
  175.     >AddInputFilter</directive> or <directive module="mod_mime"
  176.     >AddOutputFilter</directive> directives may be included or excluded
  177.     from matching by using the <directive module="mod_mime"
  178.     >MultiviewsMatch</directive> directive.</p>
  179.  
  180.     <section id="charset"><title>Charset</title>
  181.       <p>To convey this further information, Apache optionally sends
  182.       a <code>Content-Language</code> header, to specify the language
  183.       that the document is in, and can append additional information
  184.       onto the <code>Content-Type</code> header to indicate the
  185.       particular character set that should be used to correctly
  186.       render the information.</p>
  187.  
  188.       <example>
  189.         Content-Language: en, fr<br />
  190.     Content-Type: text/plain; charset=ISO-8859-1
  191.       </example>
  192.  
  193.       <p>The language specification is the two-letter abbreviation
  194.       for the language. The <code>charset</code> is the name of the
  195.       particular character set which should be used.</p>
  196.     </section>
  197. </section>
  198.  
  199. <directivesynopsis>
  200. <name>AddCharset</name>
  201. <description>Maps the given filename extensions to the specified content
  202. charset</description>
  203. <syntax>AddCharset <var>charset</var> <var>extension</var>
  204. [<var>extension</var>] ...</syntax>
  205. <contextlist><context>server config</context><context>virtual host</context>
  206. <context>directory</context><context>.htaccess</context></contextlist>
  207. <override>FileInfo</override>
  208.  
  209. <usage>
  210.     <p>The <directive>AddCharset</directive> directive maps the given
  211.     filename extensions to the specified content charset. <var>charset</var>
  212.     is the MIME charset parameter of filenames containing
  213.     <var>extension</var>. This mapping is added to any already in force,
  214.     overriding any mappings that already exist for the same
  215.     <var>extension</var>.</p>
  216.  
  217.     <example><title>Example</title>
  218.       AddLanguage ja .ja<br />
  219.       AddCharset EUC-JP .euc<br />
  220.       AddCharset ISO-2022-JP .jis<br />
  221.       AddCharset SHIFT_JIS .sjis
  222.     </example>
  223.  
  224.     <p>Then the document <code>xxxx.ja.jis</code> will be treated
  225.     as being a Japanese document whose charset is <code>ISO-2022-JP</code>
  226.     (as will the document <code>xxxx.jis.ja</code>). The
  227.     <directive>AddCharset</directive> directive is useful for both to
  228.     inform the client about the character encoding of the document so that
  229.     the document can be interpreted and displayed appropriately, and for <a
  230.     href="../content-negotiation.html">content negotiation</a>,
  231.     where the server returns one from several documents based on
  232.     the client's charset preference.</p>
  233.  
  234.     <p>The <var>extension</var> argument is case-insensitive, and can
  235.     be specified with or without a leading dot.</p>
  236. </usage>
  237. <seealso><module>mod_negotiation</module></seealso>
  238. <seealso><directive module="core">AddDefaultCharset</directive></seealso>
  239. </directivesynopsis>
  240.  
  241. <directivesynopsis>
  242. <name>AddEncoding</name>
  243. <description>Maps the given filename extensions to the specified encoding
  244. type</description>
  245. <syntax>AddEncoding <var>MIME-enc</var> <var>extension</var>
  246. [<var>extension</var>] ...</syntax>
  247. <contextlist><context>server config</context><context>virtual host</context>
  248. <context>directory</context><context>.htaccess</context></contextlist>
  249. <override>FileInfo</override>
  250.  
  251. <usage>
  252.     <p>The <directive>AddEncoding</directive> directive maps the given
  253.     filename extensions to the specified encoding type. <var>MIME-enc</var>
  254.     is the MIME encoding to use for documents containing the
  255.     <var>extension</var>. This mapping is added to any already in force,
  256.     overriding any mappings that already exist for the same
  257.     <var>extension</var>.</p>
  258.  
  259.     <example><title>Example</title>
  260.       AddEncoding x-gzip .gz<br />
  261.       AddEncoding x-compress .Z
  262.     </example>
  263.  
  264.     <p>This will cause filenames containing the <code>.gz</code> extension
  265.     to be marked as encoded using the <code>x-gzip</code> encoding, and
  266.     filenames containing the <code>.Z</code> extension to be marked as
  267.     encoded with <code>x-compress</code>.</p>
  268.  
  269.     <p>Old clients expect <code>x-gzip</code> and <code>x-compress</code>,
  270.     however the standard dictates that they're equivalent to
  271.     <code>gzip</code> and <code>compress</code> respectively. Apache does
  272.     content encoding comparisons by ignoring any leading <code>x-</code>.
  273.     When responding with an encoding Apache will use whatever form
  274.     (<em>i.e.</em>, <code>x-foo</code> or <code>foo</code>) the
  275.     client requested. If the client didn't specifically request a
  276.     particular form Apache will use the form given by the
  277.     <code>AddEncoding</code> directive. To make this long story
  278.     short, you should always use <code>x-gzip</code> and
  279.     <code>x-compress</code> for these two specific encodings. More
  280.     recent encodings, such as <code>deflate</code> should be
  281.     specified without the <code>x-</code>.</p>
  282.  
  283.     <p>The <var>extension</var> argument is case-insensitive, and can
  284.     be specified with or without a leading dot.</p>
  285. </usage>
  286. </directivesynopsis>
  287.  
  288. <directivesynopsis>
  289. <name>AddHandler</name>
  290. <description>Maps the filename extensions to the specified
  291. handler</description>
  292. <syntax>AddHandler <var>handler-name</var> <var>extension</var>
  293. [<var>extension</var>] ...</syntax>
  294. <contextlist><context>server config</context><context>virtual host</context>
  295. <context>directory</context><context>.htaccess</context></contextlist>
  296. <override>FileInfo</override>
  297.  
  298. <usage>
  299.     <p>Files having the name <var>extension</var> will be served by the
  300.     specified <var><a href="../handler.html">handler-name</a></var>. This
  301.     mapping is added to any already in force, overriding any mappings that
  302.     already exist for the same <var>extension</var>. For example, to
  303.     activate CGI scripts with the file extension <code>.cgi</code>, you
  304.     might use:</p>
  305.  
  306.     <example>
  307.       AddHandler cgi-script .cgi
  308.     </example>
  309.  
  310.     <p>Once that has been put into your httpd.conf file, any file containing
  311.     the <code>.cgi</code> extension will be treated as a CGI program.</p>
  312.  
  313.     <p>The <var>extension</var> argument is case-insensitive, and can
  314.     be specified with or without a leading dot.</p>
  315. </usage>
  316. <seealso><directive module="core">SetHandler</directive></seealso>
  317. </directivesynopsis>
  318.  
  319. <directivesynopsis>
  320. <name>AddInputFilter</name>
  321. <description>Maps filename extensions to the filters that will process
  322. client requests</description>
  323. <syntax>AddInputFilter <var>filter</var>[;<var>filter</var>...]
  324. <var>extension</var> [<var>extension</var>] ...</syntax>
  325. <contextlist><context>server config</context><context>virtual host</context>
  326. <context>directory</context><context>.htaccess</context></contextlist>
  327. <override>FileInfo</override>
  328. <compatibility>AddInputFilter is only available in Apache 2.0.26 and
  329. later.</compatibility>
  330.  
  331. <usage>
  332.     <p><directive>AddInputFilter</directive> maps the filename extension
  333.     <var>extension</var> to the <a href="../filter.html">filters</a> which
  334.     will process client requests and POST input when they are received by
  335.     the server. This is in addition to any filters defined elsewhere,
  336.     including the <directive module="core">SetInputFilter</directive>
  337.     directive. This mapping is merged over any already in force, overriding
  338.     any mappings that already exist for the same <var>extension</var>.</p>
  339.  
  340.     <p>If more than one filter is specified, they must be separated
  341.     by semicolons in the order in which they should process the
  342.     content. Both the filter and <var>extension</var> arguments are
  343.     case-insensitive, and the extension may be specified with or
  344.     without a leading dot.</p>
  345. </usage>
  346. </directivesynopsis>
  347.  
  348. <directivesynopsis>
  349. <name>AddLanguage</name>
  350. <description>Maps the given filename extension to the specified content
  351. language</description>
  352. <syntax>AddLanguage <var>MIME-lang</var> <var>extension</var>
  353. [<var>extension</var>] ...</syntax>
  354. <contextlist><context>server config</context><context>virtual host</context>
  355. <context>directory</context><context>.htaccess</context></contextlist>
  356. <override>FileInfo</override>
  357.  
  358. <usage>
  359.     <p>The <directive>AddLanguage</directive> directive maps the given
  360.     filename extension to the specified content language.
  361.     <var>MIME-lang</var> is the MIME language of filenames containing
  362.     <var>extension</var>. This mapping is added to any already in force,
  363.     overriding any mappings that already exist for the same
  364.     <var>extension</var>.</p>
  365.  
  366.     <example><title>Example</title>
  367.       AddEncoding x-compress .Z<br />
  368.       AddLanguage en .en<br />
  369.       AddLanguage fr .fr
  370.     </example>
  371.  
  372.     <p>Then the document <code>xxxx.en.Z</code> will be treated as
  373.     being a compressed English document (as will the document
  374.     <code>xxxx.Z.en</code>). Although the content language is
  375.     reported to the client, the browser is unlikely to use this
  376.     information. The <directive>AddLanguage</directive> directive is
  377.     more useful for <a href="../content-negotiation.html">content
  378.     negotiation</a>, where the server returns one from several documents
  379.     based on the client's language preference.</p>
  380.  
  381.     <p>If multiple language assignments are made for the same
  382.     extension, the last one encountered is the one that is used.
  383.     That is, for the case of:</p>
  384.  
  385.     <example>
  386.       AddLanguage en .en<br />
  387.       AddLanguage en-uk .en<br />
  388.       AddLanguage en-us .en
  389.     </example>
  390.  
  391.     <p>documents with the extension <code>.en</code> would be treated as
  392.     being <code>en-us</code>.</p>
  393.  
  394.     <p>The <var>extension</var> argument is case-insensitive, and can
  395.     be specified with or without a leading dot.</p>
  396. </usage>
  397. <seealso><module>mod_negotiation</module></seealso>
  398. </directivesynopsis>
  399.  
  400. <directivesynopsis>
  401. <name>AddOutputFilter</name>
  402. <description>Maps filename extensions to the filters that will process
  403. responses from the server</description>
  404. <syntax>AddOutputFilter <var>filter</var>[;<var>filter</var>...]
  405. <var>extension</var> [<var>extension</var>] ...</syntax>
  406. <contextlist><context>server config</context><context>virtual host</context>
  407. <context>directory</context><context>.htaccess</context></contextlist>
  408. <override>FileInfo</override>
  409. <compatibility>AddOutputFilter is only available in Apache 2.0.26 and
  410. later.</compatibility>
  411.  
  412. <usage>
  413.     <p>The <directive>AddOutputFilter</directive> directive maps the
  414.     filename extension <var>extension</var> to the <a
  415.     href="../filter.html">filters</a> which will process responses
  416.     from the server before they are sent to the client. This is in
  417.     addition to any filters defined elsewhere, including <directive
  418.     module="core">SetOutputFilter</directive> and <directive module="core"
  419.     >AddOutputFilterByType</directive> directive. This mapping is merged
  420.     over any already in force, overriding any mappings that already exist
  421.     for the same <var>extension</var>.</p>
  422.  
  423.     <p>For example, the following configuration will process all
  424.     <code>.shtml</code> files for server-side includes and will then
  425.     compress the output using <module>mod_deflate</module>.</p>
  426.  
  427.     <example>
  428.       AddOutputFilter INCLUDES;DEFLATE shtml
  429.     </example>
  430.  
  431.     <p>If more than one filter is specified, they must be separated
  432.     by semicolons in the order in which they should process the
  433.     content. Both the <var>filter</var> and <var>extension</var> arguments
  434.     are case-insensitive, and the extension may be specified with or
  435.     without a leading dot.</p>
  436. </usage>
  437. <seealso><directive module="mod_mime">RemoveOutputFilter</directive></seealso>
  438. </directivesynopsis>
  439.  
  440. <directivesynopsis>
  441. <name>AddType</name>
  442. <description>Maps the given filename extensions onto the specified content
  443. type</description>
  444. <syntax>AddType <var>MIME-type</var> <var>extension</var>
  445. [<var>extension</var>] ...</syntax>
  446. <contextlist><context>server config</context><context>virtual host</context>
  447. <context>directory</context><context>.htaccess</context></contextlist>
  448. <override>FileInfo</override>
  449.  
  450. <usage>
  451.     <p>The <directive>AddType</directive> directive maps the given filename
  452.     extensions onto the specified content type. <var>MIME-type</var> is the
  453.     MIME type to use for filenames containing <var>extension</var>. This
  454.     mapping is added to any already in force, overriding any mappings that
  455.     already exist for the same <var>extension</var>. This directive can
  456.     be used to add mappings not listed in the MIME types file (see the
  457.     <directive module="mod_mime">TypesConfig</directive> directive).</p>
  458.     
  459.     <example><title>Example</title>
  460.       AddType image/gif .gif
  461.     </example>
  462.  
  463.     <note>
  464.       It is recommended that new MIME types be added using the
  465.       <directive>AddType</directive> directive rather than changing the 
  466.       <directive module="mod_mime">TypesConfig</directive> file.
  467.     </note>
  468.  
  469.     <p>The <var>extension</var> argument is case-insensitive, and can
  470.     be specified with or without a leading dot.</p>
  471. </usage>
  472. <seealso><directive module="core">DefaultType</directive></seealso>
  473. <seealso><directive module="core">ForceType</directive></seealso>
  474. </directivesynopsis>
  475.  
  476. <directivesynopsis>
  477. <name>MultiviewsMatch</name>
  478. <description>The types of files that will be included when searching for
  479. a matching file with MultiViews</description>
  480. <syntax>MultiviewsMatch Any|NegotiatedOnly|Filters|Handlers
  481. [Handlers|Filters]</syntax>
  482. <default>MultiviewsMatch NegotiatedOnly</default>
  483. <contextlist><context>server config</context><context>virtual host</context>
  484. <context>directory</context><context>.htaccess</context></contextlist>
  485. <override>FileInfo</override>
  486. <compatibility>Available in Apache 2.0.26 and later.</compatibility>
  487.  
  488. <usage>
  489.     <p><directive>MultiviewsMatch</directive> permits three different
  490.     behaviors for <a href="mod_negotiation.html">mod_negotiation</a>'s
  491.     Multiviews feature.  Multiviews allows a request for a file,
  492.     <em>e.g.</em> <code>index.html</code>, to match any negotiated
  493.     extensions following the base request, <em>e.g.</em>
  494.     <code>index.html.en</code>, <code>index.html.fr</code>, or
  495.     <code>index.html.gz</code>.</p>
  496.  
  497.     <p>The <code>NegotiatedOnly</code> option provides that every extension
  498.     following the base name must correlate to a recognized
  499.     <module>mod_mime</module> extension for content negotation, <em>e.g.</em>
  500.     Charset, Content-Type, Language, or Encoding.  This is the strictest
  501.     implementation with the fewest unexpected side effects, and is the
  502.     default behavior.</p>
  503.  
  504.     <p>To include extensions associated with Handlers and/or Filters,
  505.     set the <directive>MultiviewsMatch</directive> directive to either
  506.     <code>Handlers</code>, <code>Filters</code>, or both option keywords.
  507.     If all other factors are equal, the smallest file will be served,
  508.     <em>e.g.</em> in deciding between <code>index.html.cgi</code> of 500
  509.     bytes and <code>index.html.pl</code> of 1000 bytes, the <code>.cgi</code>
  510.     file would win in this example. Users of <code>.asis</code> files
  511.     might prefer to use the Handler option, if <code>.asis</code> files are
  512.     associated with the <code>asis-handler</code>.</p>
  513.  
  514.     <p>You may finally allow <code>Any</code> extensions to match, even if
  515.     <module>mod_mime</module> doesn't recognize the extension. This was the
  516.     behavior in Apache 1.3, and can cause unpredicatable results, such as
  517.     serving .old or .bak files the webmaster never expected to be served.</p>
  518.  
  519.     <p>For example, the following configuration will allow handlers
  520.     and filters to participate in Multviews, but will exclude unknown
  521.     files:</p>
  522.  
  523.     <example>
  524.       MultiviewsMatch Handlers Filters
  525.     </example>
  526. </usage>
  527. <seealso><directive module="core">Options</directive></seealso>
  528. <seealso><module>mod_negotiation</module></seealso>
  529. </directivesynopsis>
  530.  
  531. <directivesynopsis>
  532. <name>DefaultLanguage</name>
  533. <description>Sets all files in the given scope to the specified
  534. language</description>
  535. <syntax>DefaultLanguage <var>MIME-lang</var></syntax>
  536. <contextlist><context>server config</context><context>virtual host</context>
  537. <context>directory</context><context>.htaccess</context></contextlist>
  538. <override>FileInfo</override>
  539.  
  540. <usage>
  541.     <p>The <directive>DefaultLanguage</directive> directive tells Apache
  542.     that all files in the directive's scope (<em>e.g.</em>, all files
  543.     covered by the current <directive module="core" type="section"
  544.     >Directory</directive> container) that don't have an explicit language
  545.     extension (such as <code>.fr</code> or <code>.de</code> as configured
  546.     by <directive module="mod_mime">AddLanguage</directive>) should be
  547.     considered to be in the specified <var>MIME-lang</var> language. This
  548.     allows entire directories to be marked as containing Dutch content, for
  549.     instance, without having to rename each file. Note that unlike using
  550.     extensions to specify languages, <directive>DefaultLanguage</directive>
  551.     can only specify a single language.</p>
  552.  
  553.     <p>If no <directive>DefaultLanguage</directive> directive is in force,
  554.     and a file does not have any language extensions as configured
  555.     by <directive module="mod_mime">AddLanguage</directive>, then that file
  556.     will be considered to have no language attribute.</p>
  557.  
  558.     <example><title>Example</title>
  559.       DefaultLanguage en
  560.     </example>
  561. </usage>
  562. <seealso><module>mod_negotiation</module></seealso>
  563. </directivesynopsis>
  564.  
  565. <directivesynopsis>
  566. <name>ModMimeUsePathInfo</name>
  567. <description>Tells <module>mod_mime</module> to treat <code>path_info</code>
  568. components as part of the filename</description>
  569. <syntax>ModMimeUsePathInfo On|Off</syntax>
  570. <default>ModMimeUsePathInfo Off</default>
  571. <contextlist><context>directory</context></contextlist>
  572. <compatibility>Available in Apache 2.0.41 and later</compatibility>
  573.  
  574. <usage>
  575.     <p>The <directive>ModMimeUsePathInfo</directive> directive is used to
  576.     combine the filename with the <code>path_info</code> URL component to
  577.     apply <module>mod_mime</module>'s directives to the request. The default
  578.     value is <code>Off</code> - therefore, the <code>path_info</code>
  579.     component is ignored.</p>
  580.  
  581.     <p>This directive is recommended when you have a virtual filesystem.</p>
  582.  
  583.     <example><title>Example</title>
  584.       ModMimeUsePathInfo On
  585.     </example>
  586.  
  587.     <p>If you have a request for <code>/bar/foo.shtml</code> where
  588.     <code>/bar</code> is a Location and <directive
  589.     >ModMimeUsePathInfo</directive> is <code>On</code>,
  590.     <module>mod_mime</module> will treat the incoming request as
  591.     <code>/bar/foo.shtml</code> and directives like <code>AddOutputFilter
  592.     INCLUDES .shtml</code> will add the <code>INCLUDES</code> filter to the
  593.     request. If <directive>ModMimeUsePathInfo</directive> is not set, the
  594.     <code>INCLUDES</code> filter will not be added.</p>
  595. </usage>
  596. <seealso><directive module="core">AcceptPathInfo</directive></seealso>
  597. </directivesynopsis>
  598.  
  599. <directivesynopsis>
  600. <name>RemoveCharset</name>
  601. <description>Removes any character set associations for a set of file
  602. extensions</description>
  603. <syntax>RemoveCharset <var>extension</var> [<var>extension</var>]
  604. ...</syntax>
  605. <contextlist><context>virtual host</context><context>directory</context>
  606. <context>.htaccess</context></contextlist>
  607. <override>FileInfo</override>
  608. <compatibility>RemoveCharset is only available in Apache 2.0.24 and
  609. later.</compatibility>
  610.  
  611. <usage>
  612.     <p>The <directive>RemoveCharset</directive> directive removes any
  613.     character set associations for files with the given extensions.
  614.     This allows <code>.htaccess</code> files in subdirectories to
  615.     undo any associations inherited from parent directories or the
  616.     server config files.</p>
  617.  
  618.     <p>The <var>extension</var> argument is case-insensitive, and can
  619.     be specified with or without a leading dot.</p>
  620.  
  621.     <example><title>Example</title>
  622.       RemoveCharset .html .shtml
  623.     </example>
  624. </usage>
  625. </directivesynopsis>
  626.  
  627. <directivesynopsis>
  628. <name>RemoveEncoding</name>
  629. <description>Removes any content encoding associations for a set of file
  630. extensions</description>
  631. <syntax>RemoveEncoding <var>extension</var> [<var>extension</var>]
  632. ...</syntax>
  633. <contextlist><context>virtual host</context><context>directory</context>
  634. <context>.htaccess</context></contextlist>
  635. <override>FileInfo</override>
  636.  
  637. <usage>
  638.     <p>The <directive>RemoveEncoding</directive> directive removes any
  639.     encoding associations for files with the given extensions. This
  640.     allows <code>.htaccess</code> files in subdirectories to undo
  641.     any associations inherited from parent directories or the
  642.     server config files. An example of its use might be:</p>
  643.  
  644.     <example><title>/foo/.htaccess:</title>
  645.       AddEncoding x-gzip .gz<br />
  646.       AddType text/plain .asc<br />
  647.       <Files *.gz.asc><br />
  648.       <indent>
  649.         RemoveEncoding .gz<br />
  650.       </indent>
  651.       </Files>
  652.     </example>
  653.  
  654.     <p>This will cause <code>foo.gz</code> to be marked as being
  655.     encoded with the gzip method, but <code>foo.gz.asc</code> as an
  656.     unencoded plaintext file.</p>
  657.  
  658.     <note><title>Note</title>
  659.       <p><directive>RemoveEncoding</directive> directives are processed
  660.       <em>after</em> any <directive module="mod_mime">AddEncoding</directive>
  661.       directives, so it is possible they may undo the effects of the latter
  662.       if both occur within the same directory configuration.</p>
  663.     </note>
  664.  
  665.     <p>The <var>extension</var> argument is case-insensitive, and can
  666.     be specified with or without a leading dot.</p>
  667. </usage>
  668. </directivesynopsis>
  669.  
  670. <directivesynopsis>
  671. <name>RemoveHandler</name>
  672. <description>Removes any handler associations for a set of file
  673. extensions</description>
  674. <syntax>RemoveHandler <var>extension</var> [<var>extension</var>]
  675. ...</syntax>
  676. <contextlist><context>virtual host</context><context>directory</context>
  677. <context>.htaccess</context></contextlist>
  678. <override>FileInfo</override>
  679.  
  680. <usage>
  681.     <p>The <directive>RemoveHandler</directive> directive removes any
  682.     handler associations for files with the given extensions. This allows
  683.     <code>.htaccess</code> files in subdirectories to undo any
  684.     associations inherited from parent directories or the server
  685.     config files. An example of its use might be:</p>
  686.  
  687.     <example><title>/foo/.htaccess:</title>
  688.       AddHandler server-parsed .html
  689.     </example>
  690.  
  691.     <example><title>/foo/bar/.htaccess:</title>
  692.       RemoveHandler .html
  693.     </example>
  694.  
  695.     <p>This has the effect of returning <code>.html</code> files in
  696.     the <code>/foo/bar</code> directory to being treated as normal
  697.     files, rather than as candidates for parsing (see the <module
  698.     >mod_include</module> module).</p>
  699.  
  700.     <p>The <var>extension</var> argument is case-insensitive, and can
  701.     be specified with or without a leading dot.</p>
  702. </usage>
  703. </directivesynopsis>
  704.  
  705. <directivesynopsis>
  706. <name>RemoveInputFilter</name>
  707. <description>Removes any input filter associations for a set of file
  708. extensions</description>
  709. <syntax>RemoveInputFilter <var>extension</var> [<var>extension</var>]
  710. ...</syntax>
  711. <contextlist><context>virtual host</context><context>directory</context>
  712. <context>.htaccess</context></contextlist>
  713. <override>FileInfo</override>
  714. <compatibility>RemoveInputFilter is only available in Apache 2.0.26 and
  715. later.</compatibility>
  716.  
  717. <usage>   
  718.     <p>The <directive>RemoveInputFilter</directive> directive removes any
  719.     input filter associations for files with the given extensions.
  720.     This allows <code>.htaccess</code> files in subdirectories to
  721.     undo any associations inherited from parent directories or the
  722.     server config files.</p>
  723.  
  724.     <p>The <var>extension</var> argument is case-insensitive, and can
  725.     be specified with or without a leading dot.</p>
  726. </usage>
  727. </directivesynopsis>
  728.  
  729. <directivesynopsis>
  730. <name>RemoveLanguage</name>
  731. <description>Removes any language associations for a set of file
  732. extensions</description>
  733. <syntax>RemoveLanguage <var>extension</var> [<var>extension</var>]
  734. ...</syntax>
  735. <contextlist><context>virtual host</context><context>directory</context>
  736. <context>.htaccess</context></contextlist>
  737. <override>FileInfo</override>
  738. <compatibility>RemoveLanguage is only available in Apache 2.0.24 and
  739. later.</compatibility>
  740.  
  741. <usage>
  742.     <p>The <directive>RemoveLanguage</directive> directive removes any
  743.     language associations for files with the given extensions. This
  744.     allows <code>.htaccess</code> files in subdirectories to undo
  745.     any associations inherited from parent directories or the
  746.     server config files.</p>
  747.  
  748.     <p>The <var>extension</var> argument is case-insensitive, and can
  749.     be specified with or without a leading dot.</p>
  750. </usage>
  751. </directivesynopsis>
  752.  
  753. <directivesynopsis>
  754. <name>RemoveOutputFilter</name>
  755. <description>Removes any output filter associations for a set of file
  756. extensions</description>
  757. <syntax>RemoveOutputFilter <var>extension</var> [<var>extension</var>]
  758. ...</syntax>
  759. <contextlist><context>virtual host</context><context>directory</context>
  760. <context>.htaccess</context></contextlist>
  761. <override>FileInfo</override>
  762. <compatibility>RemoveOutputFilter is only available in Apache 2.0.26 and
  763. later.</compatibility>
  764.  
  765. <usage>    
  766.     <p>The <directive>RemoveOutputFilter</directive> directive removes any
  767.     output filter associations for files with the given extensions.
  768.     This allows <code>.htaccess</code> files in subdirectories to
  769.     undo any associations inherited from parent directories or the
  770.     server config files.</p>
  771.  
  772.     <p>The <var>extension</var> argument is case-insensitive, and can
  773.     be specified with or without a leading dot.</p>
  774.  
  775.     <example><title>Example</title>
  776.       RemoveOutputFilter shtml
  777.     </example>
  778. </usage>
  779. <seealso><directive module="mod_mime">AddOutputFilter</directive></seealso>
  780. </directivesynopsis>
  781.  
  782. <directivesynopsis>
  783. <name>RemoveType</name>
  784. <description>Removes any content type associations for a set of file
  785. extensions</description>
  786. <syntax>RemoveType <var>extension</var> [<var>extension</var>]
  787. ...</syntax>
  788. <contextlist><context>virtual host</context><context>directory</context>
  789. <context>.htaccess</context></contextlist>
  790. <override>FileInfo</override>
  791.  
  792. <usage>
  793.     <p>The <directive>RemoveType</directive> directive removes any MIME
  794.     type associations for files with the given extensions. This allows
  795.     <code>.htaccess</code> files in subdirectories to undo any
  796.     associations inherited from parent directories or the server
  797.     config files. An example of its use might be:</p>
  798.  
  799.     <example><title>/foo/.htaccess:</title>
  800.       RemoveType .cgi
  801.     </example>
  802.  
  803.     <p>This will remove any special handling of <code>.cgi</code>
  804.     files in the <code>/foo/</code> directory and any beneath it,
  805.     causing the files to be treated as being of the <directive
  806.     module="core">DefaultType</directive>.</p>
  807.  
  808.     <note><title>Note</title>
  809.       <p><directive>RemoveType</directive> directives are processed
  810.       <em>after</em> any <directive module="mod_mime">AddType</directive>
  811.       directives, so it is possible they may undo the effects of the
  812.       latter if both occur within the same directory configuration.</p>
  813.     </note>
  814.  
  815.     <p>The <var>extension</var> argument is case-insensitive, and can
  816.     be specified with or without a leading dot.</p>
  817. </usage>
  818. </directivesynopsis>
  819.  
  820. <directivesynopsis>
  821. <name>TypesConfig</name>
  822. <description>The location of the <code>mime.types</code> file</description>
  823. <syntax>TypesConfig <var>file-path</var></syntax>
  824. <default>TypesConfig conf/mime.types</default>
  825. <contextlist><context>server config</context></contextlist>
  826.  
  827. <usage>
  828.     <p>The <directive>TypesConfig</directive> directive sets the location
  829.     of the MIME types configuration file. <var>File-path</var> is relative
  830.     to the <directive module="core">ServerRoot</directive>. This file sets
  831.     the default list of mappings from filename extensions to content
  832.     types. Most administrators use the provided <code>mime.types</code>
  833.     file, which associates common filename extensions with IANA registered
  834.     content types. The current list is maintained at <a href=
  835.     "http://www.isi.edu/in-notes/iana/assignments/media-types/media-types"
  836.     >http://www.isi.edu/in-notes/iana/assignments/media-types/media-types</a>.
  837.     This simplifies the <code>httpd.conf</code> file by providing the
  838.     majority of media-type definitions, and may be overridden by
  839.     <directive module="mod_mime">AddType</directive> directives as
  840.     needed. You should not edit the <code>mime.types</code> file, because
  841.     it may be replaced when you upgrade your server.</p>
  842.  
  843.     <p>The file contains lines in the format of the arguments to
  844.     an <directive module="mod_mime">AddType</directive> directive:</p>
  845.  
  846.     <example>
  847.       <var>MIME-type</var> [<var>extension</var>] ...
  848.     </example>
  849.  
  850.     <p>The case of the extension does not matter. Blank lines, and lines
  851.     beginning with a hash character (<code>#</code>) are ignored.</p>
  852.  
  853.     <note>
  854.       Please do <strong>not</strong> send requests to the Apache HTTP
  855.       Server Project to add any new entries in the distributed
  856.       <code>mime.types</code> file unless (1) they are already
  857.       registered with IANA, and (2) they use widely accepted,
  858.       non-conflicting filename extensions across platforms.
  859.       <code>category/x-subtype</code> requests will be automatically
  860.       rejected, as will any new two-letter extensions as they will
  861.       likely conflict later with the already crowded language and
  862.       character set namespace.
  863.     </note>
  864. </usage>
  865. <seealso><module>mod_mime_magic</module></seealso>
  866. </directivesynopsis>
  867.  
  868. </modulesynopsis>
  869.